import smtplib
from email.mime.text import MIMEText


def send_my():
    msg = MIMEText('您的程序已执行完毕，请及时上线检查！\n\n这是系统自动发出邮件，请不要回复。', 'plain', 'utf-8')
    msg['From'] = '<971993723@qq.com>'
    msg['To'] = '<971993723@qq.com>'
    msg['Subject'] = '您的程序已执行完毕！'
    from_addr = '971993723@qq.com'

    # 密码是授权码
    password = 'felupyzyyzdzbddf'
    to_addr = '971993723@qq.com'
    smtp_server = 'smtp.qq.com'

    server = smtplib.SMTP_SSL(smtp_server)

    server.set_debuglevel(1)

    server.login(from_addr, password)
    server.sendmail(from_addr, [to_addr], msg.as_string())
    # 退出
    server.quit()
